
// TODO Base all classes on MathObject and use that instead of typename T in storage (for matricies for example)
//      To make this usefull we would need to use pointers in storage, ie allocate dynamically on the heap
//      Containers (matricies) would have to delete/new on assignment


//operator overloading
//http://www.codeguru.com/forum/showthread.php?t=401691



#include <iostream>

#include "math.h"




template<size_t n, size_t m, typename T>
void PrintMatrix(Matrix<n,m,T> matrix)
{
    for(size_t row=0;row<matrix.Rows();++row)
    {
        for(size_t col=0;col<matrix.Columns();++col)
          std::cout << matrix.Element(row,col) << " ";
        std::cout << "\n";
    }
}

int main()
{
    Scalar d1[]={1,2,3};
    Scalar d2[]={4,5,6};

    Vector<3> v1(d1);
    Vector<3> v2(d2);

    std::cout << "v1: ";
    PrintMatrix(v1);
    std::cout << "v2: ";
    PrintMatrix(v2);
    std::cout << "Dot Product:   " << v1*v2
            << "\nAngle:         " << Angle(v1,v2)
            << "\nDistance:      " << Distance(v1,v2)
            << "\nPerpendicular: " << (IsPerpendicular(v1,v2)?"yes":"no");

    std::cout << "\n\n";
    PrintMatrix(Identity<4>()*3);

    std::cout << "\n";
    PrintMatrix(v1);
    std::cout << "\n";
    PrintMatrix(v2.Transpose());
}

